package com.chen.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class BookMapper {

    @Autowired
    StringRedisTemplate stringRedisTemplate;//操作string类型的增删改查

    public void saveBook(String key,String value){
        stringRedisTemplate.opsForValue().set(key, value);
    }

    public String getValue(String key) {
       return stringRedisTemplate.opsForValue().get(key);
    }
}
